import random

# 初始化牌堆
cards = []
for i in range(1, 14):
    for j in range(4):
        cards.append(i)

# 洗牌
random.shuffle(cards)

# 初始化玩家手牌
player1 = []
player2 = []
player3 = []
leftover = []

# 发牌
for i in range(len(cards)):
    if i >= len(cards) - 3:
        leftover.append(cards[i])
    elif i % 3 == 0:
        player1.append(cards[i])
    elif i % 3 == 1:
        player2.append(cards[i])
    else:
        player3.append(cards[i])

# 排序
player1.sort()
player2.sort()
player3.sort()

# 打印玩家手牌
print("Player 1:", player1)
print("Player 2:", player2)
print("Player 3:", player3)
print("Leftover:", leftover)